package com.gitee.wsl.mathematics.geometry.d2.circle


import com.gitee.wsl.mathematics.coordinate.d2.Coordinate2
import com.gitee.wsl.mathematics.geometry.d2.AbstractShape
import com.gitee.wsl.mathematics.geometry.d2.CloseShape2d
import com.gitee.wsl.mathematics.geometry.d2.Segment2d
import com.gitee.wsl.mathematics.geometry.d2.contour.ShapeContour
import com.gitee.wsl.mathematics.interpolator.ext.ratio
import com.gitee.wsl.mathematics.vector.vec2.Vec2f
import com.gitee.wsl.unit.angle.AngleUnit
import com.gitee.wsl.unit.angle.ext.plus


interface CircleSegment2d<N:Number,V: Coordinate2<N, V>,S: CircleShape2d<N, V>>: Segment2d<N, V, S> {

    val startAngle: AngleUnit
    val sweepAngle: AngleUnit

    val start:V get() = parent.getPointOnAngle(startAngle)
    val end:V get() = parent.getPointOnAngle(startAngle + sweepAngle)

    override val area: N
        get() = parent.area * (sweepAngle.ratio.value)

    override val center: V
        get() = parent.center

}

open class CircleSegment(
    override val parent: Circle,
    override val startAngle: AngleUnit = AngleUnit.ZERO,
    override val sweepAngle: AngleUnit
):AbstractShape(proxy = parent.proxy),CircleSegment2d<Float, Vec2f, Circle>{

    override fun getBounds(): CloseShape2d<Float, Vec2f> {
        TODO("Not yet implemented")
    }

    override val perimeter: Float
        get() = TODO("Not yet implemented")

    override fun containsPoint(p: Coordinate2<Float, *>): Boolean {
        TODO("Not yet implemented")
    }

    override val contour: ShapeContour
        get() = TODO("Not yet implemented")
}